package com.ball.common.config;



import com.ball.common.interceptors.TokenInterceptor;
import com.ball.common.interceptors.UserInfoInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfiguration implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 1.添加用户信息拦截器
        registry.addInterceptor(new UserInfoInterceptor()).order(1);
        registry.addInterceptor(new TokenInterceptor()).order(0)
                //排除登录接口
                .excludePathPatterns("/appUser/WXLogin","/appUser/login", "/appUser/register", "/appUser/sendCode","/url","/ball/*");



    }
}
